var t = require;
var e = module;
var o = exports;
var i, n = this && this.__extends || (i = function (t, e) {
    return (i = Object.setPrototypeOf || {
        __proto__: []
    }
        instanceof Array &&
        function (t, e) {
            t.__proto__ = e
        } ||
        function (t, e) {
            for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o])
        })(t, e)
},
    function (t, e) {
        function o() {
            this.constructor = t
        }
        i(t, e),
            t.prototype = null === e ? Object.create(e) : (o.prototype = e.prototype, new o)
    }),
    a = this && this.__decorate ||
        function (t, e, o, i) {
            var n, a = arguments.length,
                r = a < 3 ? e : null === i ? i = Object.getOwnPropertyDescriptor(e, o) : i;
            if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(t, e, o, i);
            else for (var s = t.length - 1; s >= 0; s--)(n = t[s]) && (r = (a < 3 ? n(r) : a > 3 ? n(e, o, r) : n(e, o)) || r);
            return a > 3 && r && Object.defineProperty(e, o, r),
                r
        };
Object.defineProperty(o, "__esModule", {
    value: !0
});
var r = t("AudioManager"),
    s = t("GameConstant"),
    l = t("Util"),
    c = t("AssetsManager"),
    d = t("PlaneBomb"),
    h = cc._decorator,
    p = h.ccclass,
    u = h.property,
    f = function (t) {
        function e() {
            var e = null !== t && t.apply(this, arguments) || this;
            return e.sp_plane = null,
                e._gameManage = null,
                e.speed = 300,
                e.isUpdate = !1,
                e
        }
        return n(e, t),
            e.prototype.start = function () {
                this.sp_plane.setAnimation(0, "animation1", !0),
                    r.default.Ins.playSound(s.audioManager.plane)
            },
            e.prototype.init = function (t) {
                var e = this;
                this._gameManage = t,
                    this.isUpdate = !0,
                    this.schedule(this.throwBombs, .5),
                    this.scheduleOnce(function () {
                        e.node.destroy()
                    },
                        5)
            },
            e.prototype.throwBombs = function () {
                var t = this;
                if (!t || !t.node) return;

                l.Util.getAssets(l.Util.getBundle(c.BundleName.XIE), "Prefabs/game/skill/bomb").then(function (e) {
                    console.log("炸弹", e);
                    var o = cc.instantiate(e);
                    o.getComponent(d.default).init(t._gameManage),
                        o.setPosition(t.node.position),
                        o.y -= 50,
                        t._gameManage.container.addChild(o)
                })
            },
            e.prototype.update = function (t) {
                this.isUpdate && (this.node.x += this.speed * t)
            },
            a([u(sp.Skeleton)], e.prototype, "sp_plane", void 0),
            a([p], e)
    }(cc.Component);
o.default = f